#region Using directives
using System;
#endregion

namespace SharpWind.Math
{
	public class MathHelper
	{
		#region Methods

		public static float Abs( float value )
		{
			return System.Math.Abs( value );
		}

		public static float Atan2( float y, float x )
		{
			return (float)System.Math.Atan2( y, x );
		}

		public static float Clamp( float value, float min, float max )
		{
			value = ( value > max ) ? max : value;
			value = ( value < min ) ? min : value;
			
			return value;
		}

		public static float Cos( float value )
		{
			return (float)System.Math.Cos( value );
		}

		public static float Distance( float value1, float value2 )
		{
			return Abs( value1 - value2 );
		}

		public static float Lerp( float value1, float value2, float amount )
		{
			return ( value1 + ( ( value2 - value1 ) * amount ) );
		}

		public static float Max( float value1, float value2 )
		{
			return System.Math.Max( value1, value2 );
		}

		public static float Min( float value1, float value2 )
		{
			return System.Math.Min( value1, value2 );
		}

		public static float Sin( float value )
		{
			return (float)System.Math.Sin( value );
		}

		public static float Sqrt( float value )
		{
			return (float)System.Math.Sqrt( value );
		}

		public static float Tan( float value )
		{
			return (float)System.Math.Tan( value );
		}

		public static float ToDegrees( float radians )
		{
			return radians * 57.29578f;
		}

		public static float ToRadians( float degrees )
		{
			return degrees * 0.01745329f;
		}

		#endregion

		#region Properties

		public static float E
		{
			get
			{
				return 2.718282f;
			}
		}

		public static float Epsilon
		{
			get
			{
				return 0.001f;
			}
		}

		public static float Log10E
		{
			get
			{
				return 0.4342945f;
			}
		}

		public static float Log2E
		{
			get
			{
				return 1.442695f;
			}
		}

		public static float Pi 
		{
			get
			{
				return 3.141593f;
			}
		}

		public static float PiOver2
		{
			get
			{
				return 1.570796f;
			}
		}

		public static float PiOver4
		{
			get
			{
				return 0.7853982f;
			}
		}

		public static float TwoPi
		{
			get
			{
				return 6.283185f;
			}
		}

		#endregion
	}
}